#ifndef LEVEL_H
#define LEVEL_H

/*!
 * \file level.h
 * \brief Header of class CLevel
 * \author Benjamin Toueg
 * \version 20.05.09
 */

#include <GL/glew.h>
#include "tile.h"
#include "player.h"
#include "snake.h"

class CLevel
{
public:
//    CLevel(CTextureManager * ptm, CMeshManager * pmm, CSoundManager * psm);
    CLevel(CGlobalManager* pGM);
    ~CLevel();
    void        checkIfCLevelCleared();
    void        deplacerCPlayer(const sf::Key::Code& iKeyEnum);
    void        deplacerCSnakes();
    void        draw(CTextureManager* texture_manager_ptr,CMeshManager* mesh_manager_ptr);
    CPlayer*     getCPlayerPtr() { return &m_player; };
    void        giveOwnCTile(CGameCharacter *perso);
    void        giveCTilesToChange(CGameCharacter *perso);
    bool        isFinished() const { return m_bIsFinished; };
    void        keyDown(const sf::Key::Code& iKeyEnum);
    void        killCPlayer();
    void        messageToWrite();
    void        goToNextCLevel();
    void        goToPreviousCLevel();
    void        setCLevel(); //on initialise le niveau
    void        think();

private:
    static const int NOMBRE_DE_NIVEAUX = 10;
    static const int LARGEUR_NIVEAU = 12;
    static const int HAUTEUR_NIVEAU = 10;
//    CTextureManager * m_texture_manager_ptr;
//    CMeshManager * m_mesh_manager_ptr;
//    CSoundManager * m_sound_manager_ptr;
    CGlobalManager* m_pGlobalManager;
    unsigned int m_uiLevelNumber;
    int score;
    bool m_bIsFinished;
    std::vector<CTile> all_tiles;
    std::vector<CSnake> all_snakes;
    CPlayer m_player;
};

#endif //LEVEL_H
